/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.langage.commande.serveur.message.cor;

import com.desanonymerUtilisateurs.ConnectDatabase;
import com.lloseng.ocsf.server.AbstractServer;
import com.lloseng.ocsf.server.ConnectionToClient;

/**
 *
 * @author Touf
 */
public class AnalyseurCreateSondage extends AbstractAnalyseurClientMessage {

    public AnalyseurCreateSondage(AbstractAnalyseurClientMessage suivant, AbstractServer server) {
        super(suivant, server);
    }
   
    
    @Override
    protected boolean analyseCommande(String chaine, ConnectionToClient client) {
        if(chaine.trim().toLowerCase().startsWith("#createsondage")){
            String[] str=chaine.split(" ");
            String question = str[1];
            boolean visibilite = Boolean.valueOf(str[2]);
            ConnectDatabase connect = new ConnectDatabase();
            connect.connectDatabase();
            connect.createSondage(client.getInfo("id").toString(), chaine, true);
            return true;
        }
        return false;
    }
    
}
